/**
 * 
 */
package com.google.code.netz.wfe.store;

import java.util.HashMap;

import javax.persistence.EntityManager;
import javax.persistence.Persistence;

import com.google.inject.Provider;

/**
 * @author <a href='mailto:rahul.thakur.xdev@gmail.com'>Rahul Thakur</a>
 * 
 */
public class JpaProvider implements Provider<EntityManager> {

	private static final String PERSISTENCE_UNIT__STORE = "netz-store";

	/**
	 * {@inheritDoc}
	 * 
	 * @see com.google.inject.Provider#get()
	 */
	public EntityManager get() {
		// Create and return an Entity Manager.
		EntityManager entityManager = Persistence.createEntityManagerFactory(PERSISTENCE_UNIT__STORE,
				new HashMap<String, String>()).createEntityManager();
		return entityManager;
	}

}
